import Vue from 'vue'
import VueRouter from 'vue-router'
import BigScreen from '../components/bigScreen'
import EditBigScreen from '../components/bigScreen/edit'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '*', redirect: '/edit' },
    { path: '/edit', component: EditBigScreen },
    { path: '/index', component: BigScreen },
    // {
    //   path: '/home', redirect: '/welcome', component: Home,
    //   children: [
    //     { path: '/welcome', component: Welcome },
    //     { path: '/users', component: () => import('../components/users/Users.vue') },
    //     { path: '/users/detail/:id', component: () => import('../components/users/UserDetail.vue') },
    //     { path: '/content', component: () => import('../components/content/Content') },
    //     { path: '/consultation', component: () => import('../components/consultation/Consultation.vue') },
    //     { path: '/consultation/:id', component: () => import('../components/consultation/ConsultationForUser.vue') },
    //   ]
    // },

  ]
})
// router.beforeEach((to, from, next) => {
//   if (to.path === '/login') return next()
//   const tokenstr = localStorage.getItem('token')
//   if (!tokenstr) {
//     Vue.prototype.$message.error('请先登录');
//     return next('/login')
//   }
//   next()

// })

export default router
